Numeric Constants
A numeric constant is what is commonly called a constant. In C + +, numeric constants are type-sensitive, and their types are recognized in literal form.
Type of integer constant (integer)As you know in the previous section:
C + + data typesthe object that the computer handles is the data, and the data is in a certain form (for example, integers, floating-point numbers, characters, etc.). There are often some links between different data (for example, a number of
3.2.2 Constantsand variables can be used in the program to express those that may change the amount of data corresponding to, in C + +, we use constants to express those always remain unchanged data volume. In simple terms, the values, characters,
3.2.2 Constantsand variables can be used in the program to express those that may change the amount of data corresponding to, in C + +, we use constants to express those always remain unchanged data volume. In simple terms, the values, characters,
Constants are fixed values that do not change during program execution. These fixed values, also known as literal quantities.Constants can be any of the basic data types and can be grouped into integer numbers, floating-point numbers, characters,
C Constants
Constants are fixed values that do not change during program execution. These fixed values, also known as literal quantities.
Constants can be any of the basic data types, such as integer constants, floating-point constants, character
First release, but also in the revision of the perfect.In a program run, the amount whose value cannot be changed becomes a constant. In the basic data type, constants can be divided into integer constants, real constants, symbolic constants, and
Tips"Effective Java, third Edition" an English version has been published, the second edition of this book presumably many people have read, known as one of the four major Java books, but the second edition of 2009 published, to now nearly 8 years,
(1) different compiler processing methodsDefine macros are expanded during the preprocessing phase.Const constants are used during the compile run phase.(2) Different types and security checksDefine macros have no type, do not do any type checking,
Chapter 1 Constants
A constant is an identifier whose value remains unchanged during running. The C language uses # define to define constants (called macro constants ). In addition to # define, the C ++ language can also use const to define
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.